<nav class="navbar navbar-expand-lg">
    <div class="search-panel">
        <div class="search-inner d-flex align-items-center justify-content-center">
            <div class="close-btn">Close <i class="fa fa-close"></i></div>
            <form id="searchForm" action="#">
                <div class="form-group">
                    <input type="search" name="search" placeholder="What are you searching for...">
                    <button type="submit" class="submit">Search</button>
                </div>
            </form>
        </div>
    </div>
    <div class="container-fluid d-flex align-items-center justify-content-between">
        <div class="navbar-header">
            <!-- Navbar Header--><a href="home.html" class="navbar-brand">
            <div class="brand-text brand-big visible text-uppercase"><strong class="text-primary">小标</strong><strong>会议平台</strong></div>
            <div class="brand-text brand-sm"><strong class="text-primary">X</strong><strong>B</strong></div>
        </a>
            <!-- Sidebar Toggle Btn-->
            <button class="sidebar-toggle"><i class="fa fa-long-arrow-left"></i></button>
        </div>
        <div class="right-menu list-inline no-margin-bottom">
            <!-- Log out -->
            <div class="list-inline-item logout">
                <a id="logout" href="javascript:" @click="loginOut" class="nav-link"><span class="d-none d-sm-inline">Logout </span></a>
            </div>
        </div>
    </div>
</nav>

<script>
    new Vue({
        el: ".navbar",
        data: {},
        methods: {
            loginOut:function () {
                axios({
                    url:"/user/loginOut"
                }).then(res => {
                    if (res.data.flag){
                        //清除本地储存
                        localStorage.removeItem("loginUser");

                        //清空cookie
                        $.removeCookie("userId", {path:"/"});

                        // 跳转到首页
                        location.href = '/index.html';
                    }else {
                        layer.msg(res.data.message);
                    }
                });
            }
        }
    })
</script>